package controller;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JComponent;

public class EditEventKeyListener implements KeyListener{

	@Override
	public void keyPressed(KeyEvent e) {


	}

	@Override
	public void keyReleased(KeyEvent e) {
		String name = ((JComponent) e.getSource()).getName();
		switch (name){
		case "nome":
		{
			Engine.setText(20, e, "[a-zA-Z0-9 'éèàòùì].*");
		}break;
		case "luogo":
		{
			Engine.setText(50, e, "[a-zA-Z0-9 'éèàòùì].*");
		}break;
		case "desc":
		{
			Engine.setText(1000, e, "[a-zA-Z 0-9!£$%&/()=?'^ìòàùèé].*");
		}break;
		}
	}

	@Override
	public void keyTyped(KeyEvent e) {


	}

}
